import request from '@/utils/request'

export const list = 'ftp/list'

export function newFolder (data) {
  return request({
    url: 'ftp/newFolder',
    method: 'post',
    params: data
  })
}

export function del (data) {
  return request({
    url: 'ftp/delete',
    method: 'delete',
    params: data
  })
}

export function rename (data) {
  return request({
    url: 'ftp/rename',
    method: 'post',
    params: data
  })
}

export function download (data) {
  return request({
    url: 'ftp/download',
    method: 'get',
    params: data,
    responseType: 'blob'
  })
}

export function updateFile (data) {
  return request({
    url: 'ftp/updateFile',
    method: 'post',
    data
  })
}

export function findProcess (data) {
  return request({
    url: 'ftp/findProcess',
    method: 'get',
    params: data
  })
}

export default { list, newFolder, del, rename, download, updateFile, findProcess }
